<%-- 
    Document   : menu
    Created on : May 5, 2011, 5:46:32 AM
    Author     : christophe
--%>

<%@tag description="put the tag description here" pageEncoding="UTF-8"%>

<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>
<%@ taglib uri="http://struts.apache.org/tags-html" prefix="html" %>
<%@ taglib uri="http://struts.apache.org/tags-logic" prefix="logic" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@taglib  prefix="tags" uri="/WEB-INF/tlds/tags" %>

<%@attribute name="currentMenu" required="false"%>

<div id = "top">
    <c:choose>
        <c:when test="${sessionScope.user ne null}">
            <span class="loggedIn">
                Logged in as <c:out value="${sessionScope.user.username}" />
            </span>
            &nbsp;
            &nbsp;
            <c:url var="logoutUrl" value="/user/logout.do" />
            <span class="logout">
                <a href="${logoutUrl}">Logout</a>
            </span>
        </c:when>
        <c:otherwise>
            <span class="newUser">Welcome new Garage Salesman/Saleswoman!</span>
        </c:otherwise>
    </c:choose>


</div>
<div id = "header">
    <c:url var="bannerUrl" value="/images/banner1.gif" />
    <img alt="" src="${bannerUrl}" style="width: 780px; height: 162px" />
</div>
<div id = "menu">

    <div class="menuItemTopSpace" style="padding-top: 10px;">
        <!-- Nothing need be here -->
    </div>


    <div id="menuItem">
        <c:url var="createItemUrl" value="/user/viewUser.do" />
        <a href="${createItemUrl}"> Home </a>
    </div>

    <div id="menuItem">
        <c:url var="listItemsUrl" value="/user/listItems.do" />
        <a href="${listItemsUrl}"> Browse the Garage </a>
    </div>

    <div id="menuItem">
        <c:url var="createItemUrl" value="/user/viewItem.do?action=create" />
        <a href="${createItemUrl}"> Sell Something </a>
    </div>



    <jsp:doBody />

    <br />
    <br />

    <c:set var="cart" value="${sessionScope.cart}" />

    <span class="viewCart">
        <c:url var="cartUrl" value="/user/viewUser.do" />
        <a href="${cartUrl}">Cart(${cart.cartSize})</a>
    </span>


    <span class="checkoutLink">
        <c:url var="checkUrl" value="/user/checkout.do" />
        <a href="${checkUrl}">Checkout</a>
    </span>



</div>
